<!DOCTYPE html>
<html>
<head>
	<title></title>
	<meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
	<link rel="stylesheet" type="text/css" href="/static/css/hw-admin.css">
    <link rel="stylesheet" href="/static/css/lb.css"> 
    <style>
        /* #table-form td,th{
            text-align: center;
        } */
        th {
            font-weight: 500;
        }
        th,td,.name {
            text-align: center !important;
        }
        .ll td,.ll th {
            border-right: 1px solid #e5e5e5;
        }
    </style>
   	<!--[if lt IE 9]>
    　 <script src="https://cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js"></script>
       <script src="https://cdn.bootcss.com/respond.js/1.4.2/respond.js"></script>
    <![endif]-->
</head>
<body>

	<div class="hw-iframe">
		<!-- 顶部标题 -->
        <div class="hw-header-wrapper">
            <div class="hw-header">
                <div class="hw-header__item--left">
                    订单详情
                </div>
            </div>
        </div>
        <div class="hw-group">
            <div class="group-title">订单信息</div>
            <div class="main-table-wrap" style="margin-top: 20px;"> 
                <table class="info-table"  border="0">  
                    <colgroup>
                        <col class="col-5"> 
                        <col class="col-15">
                        <col class="col-5"> 
                        <col class="col-15">
                    </colgroup>
                    <tbody>
                        <tr>
                            <td class="name">订单号</td>
                            <td><?=$order['orderNumber'] ?></td>
                            <td class="name">订单状态</td>
                            <td>
                            <?php
                                switch ($order['status']) {
                                    case 'reserved':
                                        echo '预定中';
                                        break;
                                    
                                    case 'checked-in':
                                        echo '已入住';
                                        break;

                                    case 'checked-out':
                                        echo '已退房';
                                        break;

                                    case 'cancelled':
                                        echo '已取消';
                                        break;
                                }
                            ?>
                            </td>
                        </tr>

                        <tr>
                            <td class="name">订单金额</td>
                            <td><?=$order['total_price'] ?></td>
                            <td class="name">共_晚</td>
                            <td><?=round((strtotime($order['checkOutTime']) - strtotime($order['checkInTime'])) / 3600 / 24) ?></td>
                        </tr>

                        <tr>
                            <td class="name">入住时间</td>
                            <td><?=$order['checkInTime'] ?></td>
                            <td class="name">离店时间</td>
                            <td><?=$order['checkOutTime'] ?></td>
                        </tr>
                        <tr>
                            <td class="name">订单预订来源</td>
                            <td><?=$order['type'] == 'normal' ? '散客上门' : '团队入住' ?></td>
                            <td class="name">入住方式</td>
                            <td><?=$order['checkInChannel'] == 'unknown' ? '未知' : ($order['checkInChannel'] == 'frontDesk' ? '前台办理' : '自助机办理') ?></td>
                        </tr>
                    </tbody>
                </table> 
            </div>
        </div>
        <div class="hw-group">
            <div class="group-title">入住人信息</div>
            <div class="main-table-wrap" style="margin-top: 20px;">
                <form method="POST" action="">
                    <table class="ll"  cellspacing="0" cellpadding="0" border="0">  
                        <colgroup>
                            <col class="col-5">
                            <col class="col-15">
                            <col class="col-5">
                            <col class="col-15">
                        </colgroup>

                        <thead class="people">
                            <tr>
                                <th>入住人</th>
                                <th>联系电话</th>
                                <th>身份证号</th>
                                <th>会员账号状态</th>
                            </tr>
                        </thead>

                        <tbody>
                            <?php foreach ($guests as $key => $value): ?>
                                <tr>
                                    <td><?=$value['name'] ?></td>
                                    <td><?=$this->unlock($value['phone']) ?></td>
                                    <td><?=!empty($value['idNumber']) ? substr_replace($this->unlock($value['idNumber']), '******', 6, 8) : '' ?></td>
                                    <td><?=$value['state'] ?></td>
                                </tr>
                            <?php endforeach ?>
                        </tbody>
                    </table>
                </form>
            </div>
        </div>
        <div class="hw-group">
            <div class="group-title">预订信息</div>
            <div class="main-table-wrap" style="margin-top: 20px;"> 
                <table class="info-table"  border="0">  
                    <colgroup>
                        <col class="col-5"> 
                        <col class="col-15">
                        <col class="col-5"> 
                        <col class="col-15">
                    </colgroup>
                    <tbody>
                        <tr>
                            <td class="name">预订人</td>
                            <td><?=$order['contactName'] ?></td>
                            <td class="name">联系电话</td>
                            <td><?=$this->unlock($order['contactPhone']) ?></td>
                        </tr>

                        <tr>
                            <td class="name">预定时间</td>
                            <td><?=$order['create_time'] ?></td>
                            <td class="name"></td>
                            <td></td>
                        </tr>

                    </tbody>
                </table> 
            </div>
        </div>
        <div class="hw-group">
            <div class="group-title">酒店信息</div>
            <div class="main-table-wrap" style="margin-top: 20px;"> 
                <table class="info-table"  border="0">  
                    <colgroup>
                        <col class="col-5"> 
                        <col class="col-15">
                        <col class="col-5"> 
                        <col class="col-15">
                    </colgroup>
                    <tbody>
                        <tr>
                            <td class="name">酒店编码</td>
                            <td><?=$hotel['hotel_code'] ?></td>
                            <td class="name">酒店名称</td>
                            <td><?=$hotel['name'] ?></td>
                        </tr>

                        <tr>
                            <td class="name">房型</td>
                            <td><?=$order['roomType'] ?></td>
                            <td class="name">单价</td>
                            <td><?=$hotel['room_price'] ?></td>
                        </tr>

                        <tr>
                            <td class="name">星级</td>
                            <td><?=$hotel['star_level'] ?></td>
                            <td class="name"></td>
                            <td></td>
                        </tr>
                        <tr>
                            <td class="name">酒店地址</td>
                            <td style="text-align: left !important;padding-left: 30px;" colspan="3"><?=$hotel['province'].$hotel['city'].$hotel['area'].$hotel['address'] ?></td>
                        </tr>
                    </tbody>
                </table> 
            </div>
        </div>

        <!-- 判断是否申请过开票 -->
        <?php if ($order['invoice_type'] > 0): ?>
            <div class="hw-group">
                <div class="group-title">发票信息</div>
                <div class="main-table-wrap" style="margin-top: 20px;"> 
                    <table class="info-table"  border="0">  
                        <colgroup>
                            <col class="col-5"> 
                            <col class="col-15">
                            <col class="col-5"> 
                            <col class="col-15">
                        </colgroup>
                        <tbody>
                            <tr>
                                <td class="name">开票状态</td>
                                <?php if ($order['invoice_type'] == 0): ?>
                                    <td>待申请开票</td>
                                <?php elseif ($order['invoice_type'] == 1): ?>
                                    <td class="blue-color">已申请开票</td>
                                <?php elseif ($order['invoice_type'] == 2): ?>
                                    <td class="green-color">已同意开票</td>
                                <?php elseif ($order['invoice_type'] == 3): ?>
                                    <td class="red-color">已拒绝开票</td>
                                <?php endif ?>
                                <td class="name">发票类型</td>
                                <td><?=$invoice['type'] == 0 ? '增值税专用发票' : '普通发票' ?></td>
                            </tr>

                            <tr>
                                <td class="name">发票抬头</td>
                                <td><?=$invoice['rise'] ?></td>
                                <td class="name">税号</td>
                                <td><?=$invoice['duty_num'] ?></td>
                            </tr>

                            <tr>
                                <td class="name">基本开户银行</td>
                                <td><?=$invoice['open_bank'] ?></td>
                                <td class="name">基本开户账号</td>
                                <td><?=$invoice['open_account'] ?></td>
                            </tr>
                            <tr>
                                <td class="name">注册场所地址</td>
                                <td><?=$invoice['register_address'] ?></td>
                                <td class="name">注册固定电话</td>
                                <td><?=$invoice['register_phone'] ?></td>
                            </tr>
                            <tr>
                                <td class="name">发票内容</td>
                                <td><?=$invoice['detail'] ?></td>
                                <td class="name">发票金额</td>
                                <td><?=$invoice['price'] ?></td>
                            </tr>
                            
                            <tr>
                                <td class="name">备注</td>
                                <td style="text-align: left !important;padding-left: 30px;" colspan="3"><?=$invoice['note'] ?></td>
                            </tr>
                        </tbody>
                    </table> 
                </div>
            </div>
        <?php endif ?>
        <div class="hw-btn-group">
            <div onclick="history.back(-1);" style="cursor: pointer;width: 76px;display: block;margin: 30px auto 20px;" class="hw-btn--default">
                返回
            </div>
        </div>
	</div>

	<script src="/static/lib/jquery-1.12.4.min.js"></script>
	<script type="text/javascript" src="/static/lib/My97DatePicker/WdatePicker.js"></script>
	<script type="text/javascript" src="/static/lib/jquery.form.min.js"></script>
    <script type="text/javascript" src="/static/js/common/util.js"></script>
	<script type="text/javascript" src="/static/js/common/upload.js"></script>
	<script type="text/javascript" src="/static/lib/jquery.validate.js"></script>
	<script type="text/javascript" src="/static/lib/messages_zh.js"></script>
	<script type="text/javascript" src="/static/js/common/validateExtend.js"></script>
	<script type="text/javascript" src="/static/js/common/common.js"></script>
    <!-- <script type="text/javascript" src="/static/lib/ueditor/ueditor.config.js"></script>
	<script type="text/javascript" src="/static/lib/ueditor/ueditor.all.min.js"></script>
	<script type="text/javascript" src="/static/lib/ueditor/addCustomizeDialog.js"></script> -->

</body>
</html>